package com.jsyh.maidu.adapter.home;

import android.content.Context;

import com.jsyh.maidu.R;
import com.jsyh.maidu.model.PaymentType;
import com.jsyh.shopping.uilibrary.adapter.listview.BaseAdapterHelper;
import com.jsyh.shopping.uilibrary.adapter.listview.QuickAdapter;

import java.util.List;

/**
 * Created by admin on 2017/6/9.
 */

public class PayTypeAdapter extends QuickAdapter<PaymentType> {

    public PayTypeAdapter(Context context, int layoutResId) {
        super(context, layoutResId);
    }

    public PayTypeAdapter(Context context, int layoutResId, List<PaymentType> data) {
        super(context, layoutResId, data);
    }

    @Override
    protected void convert(BaseAdapterHelper helper, PaymentType item) {

        if (item.isChecked()) {

            helper.setImageDrawable(R.id.iv_paytype_select,context.getResources().getDrawable( R.drawable.select_yes));
        }else {
            helper.setImageDrawable(R.id.iv_paytype_select,context.getResources().getDrawable( R.drawable.select_cart_goods));

        }
        helper.setText(R.id.tv_paytype_typename,item.getPay_name());
    }
}
